package viewHelper4GUI;

import java.awt.Graphics;
import java.util.ArrayList;

import painter4ViewHelper.Painter;
import painter4ViewHelper.PainterProvider;

public class ViewHelperImpl implements ViewHelper {

	private PainterProvider painterProvider;
	
	@Override
	public void paint(Graphics g) {
		ArrayList<Painter> infoList = getPainters();
		if(infoList != null) {
			for(int i = 0; i < infoList.size(); i++) {
				infoList.get(i).paint(g);			
			}
		}
	}
	
	protected ArrayList<Painter> getPainters() {
		return painterProvider.getPainters();
	}
	
	public void setPainterProvider(PainterProvider painterProvider) {
		this.painterProvider = painterProvider;
	}

}
